#version 450 core

layout (location = 0) in vec3 a_Position;
layout (location = 1) in vec4 a_Color;
layout (location = 2) in vec2 a_TexCoord;
layout (location = 3) in float a_TexIndex;
layout (location = 4) in float a_TilingFactor;
layout (location = 5) in int a_EntityID;

//layout(std140) uniform Camera {
//	mat4 u_ViewProjection;
//};

layout (location = 0) uniform mat4 u_ViewProjection;

struct VertexOutput
{
	vec4 Color;
	vec2 TexCoord;
	float TilingFactor;
	vec2 UV;//shadown test
};

layout (location = 0) out VertexOutput Output;
layout (location = 4) out float v_TexIndex;
layout (location = 5) out int v_EntityID;

void main()
{
	Output.Color = a_Color;
	Output.TexCoord = a_TexCoord;
	Output.TilingFactor = a_TilingFactor;
	v_TexIndex = a_TexIndex;
	v_EntityID = a_EntityID;

	gl_Position = u_ViewProjection * vec4(a_Position, 1.0);
	Output.UV = (a_Position.xy + vec2(1,1)) / 2.0;
}